<template>
  <div>
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
  </div>
</template>

<script>
import { getQueryCity } from '@/api/area.js'

export default {
  data () {
    return {
      value: ''
    }
  },

  created () {
  },

  methods: {
    async onSearch () {
      const res = await getQueryCity(this.value)
      console.log(res)
    },
    onCancel () {
      this.$router.back()
    }

  }
}
</script>

<style scoped lang="less"></style>
